<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/include/taglib.jsp"%>
<%@ page import="java.sql.*"%>
<%
String driverName = "com.mysql.jdbc.Driver"; //Mysql数据库连接
						String userName = "root";
						String psw = "123456"; //本行和上一行是数据库的登录名和密码
						String dbName = "test1"; //数据库名字
						String url = "jdbc:mysql://localhost:3306/test1?serverTimezone=UTC";
						Class.forName("com.mysql.jdbc.Driver");
						Connection conn = DriverManager.getConnection(url, userName, psw);
						String strSql = "";
					
						Statement stmt = conn.createStatement();%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="${ctx}/layui/css/layui.css">
<script>
	var ctx = "${ctx}";
</script>
</head>
<body>
	<form class="layui-form" style="width: 80%;" id="auf">
		<div class="layui-form-item">
			<label class="layui-form-label">商品名称</label>
			<div class="layui-input-inline">
				<select name="product_id" id="product_id"
					class="layui-input search_input" lay-verify="required"
					lay-search="">
					<option value="">--请选择要关联的商品--</option>
					<%
						//连接数据库
						
						ResultSet rs = stmt.executeQuery("SELECT product.product_name,product.product_id FROM product");

						while (rs.next()) //循环输出数据
						{
							out.print("<option value=" + rs.getInt("product_id") + ">" + rs.getString("product_name") + "</option>");
						}
					%>
				</select>
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">产品类型</label>
			<div class="layui-input-inline">
				<input type="text" name="skin" id="skin" class="layui-input"
					lay-verify="required" placeholder="请输入产品的类型" value="">
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">是否特殊材质</label>
			<div class="layui-input-inline">
			<select name="special" id="special"
						class="layui-input search_input"
						lay-search="">
						
						<option value="否">否</option>
						<option value="是">是</option>
						</select>
				<!-- <input type="text" name="special" id="special" class="layui-input"
					lay-verify="required" placeholder="请输入当前产品的种类" value=""> -->
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">产品产地</label>
			<div class="layui-input-inline">
				<input type="text" name="place" id="place" class="layui-input"
					lay-verify="required" placeholder="请输入当前产品的产地" value="">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">产品功效</label>
			<div class="layui-input-inline">
				<input type="text" name="efficacy" id="efficacy" class="layui-input"
					lay-verify="required" placeholder="请输入当前产品的功效" value="">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">产品规格</label>
			<div class="layui-input-inline">
				<input type="text" name="type" id="type" class="layui-input"
					lay-verify="required" placeholder="请输入当前产品的规格" value="">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">保质期</label>
			<div class="layui-input-inline">
				<input type="text" name="capacity" id="capacity" class="layui-input"
					lay-verify="required" placeholder="请输入当前产品的保质期" value="">
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">容量（重量）</label>
			<div class="layui-input-inline">
				<input type="text" name="shelflife" id="shelflife" class="layui-input"
					lay-verify="required" placeholder="请输入该商品的容量（重量）" value="">
			</div>
		</div>
		
		
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="addParameter">立即提交</button>
			</div>
		</div>
	</form>
	<script type="text/javascript" src="${ctx }/layui/layui.js"></script>
	<script type="text/javascript" src="${ctx }/js/parameter/addParameter.js"></script>
</body>
</html>